What is a DdsButton?

The DdsButton control allows programmers to create and customize the on-screen "buttons" commonly seen in mobile applications and on the web.

Applicability: These controls can be used in Monarch, Wings, and Mobile RPG pages/apps.

The Mechanics of a DdsButton

The DdsButton control is rendered to the user as a button with text, as a link, or as a clickable image. When the user touches or clicks the button, the screen's data is submitted back to the RPG program. Button properties determine where the 'cursor' was assumed to be at the moment of the submission and which function key is reported to have been activated.

Warning – Designers must ensure that the AidKey property is also defined in the FuncKeys property of the DdsRecord that contains it. Otherwise the button will not work.

DdsButton Property Tasks

A button may define, via the TextField and TextFieldLength, a character field which is included in the record format presented to RPG. It is through this field that a program can set the text to be presented to the user. Other interesting properties are:

Appearance

ButtonStyle It can be one of: Button, Link, Image, Icon.
IconID The ID of the Icon that will be displayed. This is often most easily set using the Icon Selection dialogs.
Image The path to the image used as the button. This path points to a location on the Web server file system.
OnMouseOverImage Path to an image shown when the mouse pointer is over the button.
Text Text to be shown in the button. This text is a constant established at design time.
TextField &
TextFieldLength
These properties define a character field whose runtime value is to be shown on the screen. If these properties are given, the Text property is ignored.

Behavior

AidKey Attention Identifier (Function) Key to report back to RPG, via indicators or through the feedback information data structure (INFDS). Also see the warning above.
FieldName The name of the field to be reported back to RPG as having 'focus' when the screen was submitted.
Protect Sets the RPG indicator expression that when evaluated, determines if the field is output-only (read-only).